/**
 * Created by asus on 2017/4/28.
 */
import * as types from './mutationTypes'

export default {
  [types.NEWS_QUERY_NEWS_BEGIN](state) {
    state.news = []
  },
  [types.NEWS_QUERY_NEWS_SUC](state, {news, currentPage, totalCount}) {
    state.news = news
    state.currentPage = currentPage
    state.totalCount = totalCount
  },
  [types.NEWS_SET_EDITING_NEWS](state, {news}) {
    state.editingNews = news
  },
  [types.NEWS_SEARCH_NEWS_SUC](state, {news, currentPage, totalCount}) {
    state.news = news
    state.currentPage = currentPage
    state.totalCount = totalCount
  },
  [types.NEWS_SET_SEARCH_TEXT](state, {searchText}) {
    state.searchText = searchText
  },
  [types.NEWS_DELETE_SUC](state) {
    //不做删减，重新请求
  },
  [types.NEWS_SEARCH_NEWS](state, {news}) {
    //state.news = news;
  },
  [types.NEWS_SET_PAGE_MODEL](state, {modelType}) {
    //''
    state.pageModel = modelType
  },
  [types.NEWS_RELEASE_SUC](state) {
  },
  [types.NEWS_UPDATE_SUC](state) {
    state.editingAffiche = null
  }
}
